package xyz.scootaloo.draft.textbook.chapter3;

/**
 * @author flutterdash@qq.com
 * @since 2021/5/31 11:08
 */
public class P3 {

    public static void main(String[] args) {
        int res = 0;
        for (int i = 1; i<=10; i++) {
            res += factorial(i);
        }
        System.out.println(res);
    }

    public static int factorial(int n) {
        int res = 1;
        for (int i = 1; i<=n; i++) {
            res *= i;
        }
        return res;
    }

}
